home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / nShell Prog / Programmer's Guide / 10 Callbacks - Paths < prev    next >
Encoding:
Text File  |  1994-09-04  |  1.3 KB  |  65 lines  |  [TEXT/ttxt]

  1. 10 Callbacks - Paths
  2. ====================
  3.  
  4. These routines allow programmers to manipulate path strings from within nShell commands.
  5.  
  6. NSH_path_expand
  7. ---------------
  8.  
  9. int  NSH_path_expand(Str255 path);
  10.  
  11. PARAMETERS
  12.  
  13.     Str255    path    address of a Pascal string to be updated
  14.  
  15. RETURNS
  16.  
  17.     0    success
  18.     others    failure
  19.  
  20. PROCESS
  21.  
  22. Given a full or partial pathname, NSH_expand will return the equivalent full pathname.  This routine does not check to see if any of the specified volumes, directories, or files exist.
  23.  
  24. This routine is equivalent to nShell's "pathchk" command.
  25.  
  26. NSH_path_to_FSSpec
  27. ------------------
  28.  
  29. int  NSH_path_to_FSSpec( Str255 pathname, FSSpec *spec );
  30.  
  31. PARAMETERS
  32.  
  33.     Str255        path    pathname to be interpreted
  34.     FSSpec    *spec    address of a FSSpec to be filled
  35.  
  36. RETURNS
  37.  
  38.     0    success
  39.     others    failure
  40.  
  41. PROCESS
  42.  
  43. Given a full pathname (perhaps prepared by NSH_expand), this routine will produce an equivalent File System Specification.  Any Finder aliases will be resolved.
  44.  
  45. NSH_path_which
  46. --------------
  47.  
  48. int  NSH_path_which(Str255 path);
  49.  
  50. PARAMETERS
  51.  
  52.     Str255    path    address of a pathname to be updated
  53.  
  54. RETURNS
  55.  
  56.     -1    an error prevented the search
  57.     0    success
  58.     1    command not found
  59.  
  60. PROCESS
  61.  
  62. This routine examines the command-search-path and returns the location of the command with would be executed.
  63.  
  64. This routine is equivalent to nShell's "which" command.
  65.